package com.lagou.dockerdemo.service.impl;

import com.lagou.dockerdemo.entity.TbStudent;
import com.lagou.dockerdemo.mapper.StudentMapper;
import com.lagou.dockerdemo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author jinshanzhang
 * @version 1.0
 * @description
 * @date 2021/12/16 5:33 下午
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Resource
    private StudentMapper studentMapper;

    @Override
    public Integer addStudent(TbStudent tbStudent) {
        return studentMapper.insert(tbStudent);
    }

    @Override
    public void updateStudent(TbStudent tbStudent) {
        studentMapper.updateById(tbStudent);
    }

    @Override
    public void deleteStudent(Integer studentId) {
        studentMapper.deleteById(studentId);
    }

    @Override
    public TbStudent selectSingleStudent(Integer studentId) {
        return studentMapper.selectById(studentId);
    }
}
